using NUnit.Framework;

using FineCollection.Test;


namespace FineCollection.Cont
{
    [TestFixture]
    public class ArrStack_test
    {
        
        [Test]
        public void test_Basic()
        {
            var stack = new ArrStack<long>();

            stack.Push(111L);
            stack.Push(222L);
            stack.Push(333L);
            stack.Push(444L);

            stack.Pop()._equals_(444L);
            stack.Pop()._equals_(333L);
            stack.Pop()._equals_(222L);
            stack.Pop()._equals_(111L);
        }
        

        [Test]
        public void test_Emptiness()
        {
            var stack = new ArrStack<long>();

            stack.IsEmpty._true_();

            stack.Push(111L);

            stack.IsEmpty._false_();

            stack.Pop();

            stack.IsEmpty._true_();
        }
        

        [Test]
        public void test_Top()
        {
            var stack = new ArrStack<long>();

            stack.Push(111L);
            stack.Push(222L);
            stack.Push(333L);

            stack.Top ._equals_(333L);

            stack.Pop();

            stack.Top. _equals_(222L);
        }


        [Test]
        public void test_Peek_basic()
        {
            var stack = new ArrStack<long>();

            stack.Push(111L);
            stack.Push(222L);
            stack.Push(333L);
            stack.Push(444L);

            stack.Peek(1) ._equals_(444L);
            stack.Peek(2) ._equals_(333L);
            stack.Peek(3) ._equals_(222L);
            stack.Peek(4) ._equals_(111L);
        }
        


    }
}